<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数据文档管理</title>

<link rel="stylesheet" href="/css/theme/App.css" type="text/css" />
<link rel="stylesheet" href="/javascript/theme/libs/jquery-easyui-1.4/themes/gray/easyui.css" type="text/css" />	
	
<script src="/javascript/theme/libs/jquery-1.9.1.min.js"></script>
<script src="/javascript/theme/App.js"></script>
<script src="/javascript/theme/libs/jquery-easyui-1.4/jquery.easyui.min.js"></script>
<style type="text/css">

.sj_tl_3 {
	line-height:33px;
	border-right:1px solid #e3e6eb;
	border-bottom:1px solid #e3e6eb;
}
.sj_tl_3 th {
	font-size:14px;
	font-weight:normal;
	border-left:1px solid #e3e6eb;
	border-top:1px solid #e3e6eb;
	background:#ebebeb;
}
.sj_tl_3 td {
	border-left:1px solid #e3e6eb;
	border-top:1px solid #e3e6eb;
	padding-right:5px;
}
</style>

<script >


$(function(){
      $("#fileCate1").combobox({
           onSelect: function(newVal,oldVal){
           var cate1 = $("#fileCate1").combobox('getValue');
           var url ="/uploadDoc/getAllFileCate2?fileCate1="+cate1;
           $("#fileCate2").combobox('reload',url);
          }
      });
      $("#fileCate1").combobox('setValue',$('#initalCate1').val());
      $("#fileCate2").combobox('setValue',$('#initalCate2').val());
});	
           
function checkParam(){
	var cate1 = $("#fileCate1").combobox('getText');
	var cate2 = $("#fileCate2").combobox('getText');
	if(cate1 !='' && cate2 != ''){
		$("#fileCate1").combobox('setValue',cate1);
		$("#fileCate2").combobox('setValue',cate2);
		return true;
	}else{
		alert("文件类别不得为空！");
		return false;
	}
}

$(function() {
	var msg = $("#message").val();
	if (msg == "success") {
		alert("更新成功！");
		window.location.href="/uploadDoc/manage/manage?initalFileName="+$('#initalFileName').val()
			+"&fileCate1="+$('#initalCate1').val()+"&fileCate2="+$('#initalCate2').val();
	} else if (msg == "error") {
		alert("更新失败!");
	} else if(msg != ""){
		alert(msg);
	}
});
</script>

</head>
<body>
<div id="content" style="OVERFLOW-X:yes;OVERFLOW-Y:auto;min-height:800px">
	<div id="content-container">
		<div class="portlet">
				<div class="portlet-header">
					<h3>
						<i class="fa fa-tasks"></i>
						文档信息修改
					</h3>
					
				</div> <!-- /.portlet-header -->

				<div class="portlet-content">
					<form onsubmit="return checkParam();"  id="searchUser" name="searchUser" action="/uploadDoc/update" method="post">
						<input type="hidden" id="fileID" name="fileID" value="$!{vo.id}"/>
						<input type="hidden" id="message" name="message" value="$!{message}" />
						<input type="hidden" id="initalFileName" name="initalFileName" value="$!{vo.initalFileName}" />
						<div align="center">
      						<table  class="sj_tl_3"  width="80%" border="0" cellspacing="0" cellpadding="0">
								<tr align="center" >
          							<th style="text-align:center ; font-family:Microsoft YaHei; font-size:14px" colspan="2">
          							<span style="color:red">提示： 如上传后的文件展示效果不好，则请将文件在本地转成 <b>PDF</b> 格式后再上传。</span>
		  							</th>
								</tr>
								<tr>
									<td align="center" >文件名称</td>
									<td align="center" >
										$!{vo.initalFileName}
									</td>
								</tr>
								<tr height="30px">
									<td align="center" >文档分类</td>
									<td align="left" >
										&nbsp;&nbsp;&nbsp;&nbsp;
										类别一:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										<input type="hidden" id="initalCate1" value="$!{vo.fileCate1}"/>
										<select id="fileCate1" name="fileCate1" style="width:180px;">
											#foreach( $cate1 in $cate1List)
												<option value="$!{cate1}"  #if($cate1 == $!{vo.fileCate1}) selected #end>$!{cate1}</option>
											#end
										 </select>
										 &nbsp;&nbsp;&nbsp;&nbsp;
										类别二:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										<input type="hidden" id="initalCate2" value="$!{vo.fileCate2}"/>
										<select class="easyui-combobox" id="fileCate2" name="fileCate2" data-options="valueField: 'value',textField: 'value'" style="width:180px;">
											#foreach( $cate2 in $cate2List)
												<option value="$!{cate2}"  #if($cate2 == $!{vo.fileCate2}) selected #end>$!{cate2}</option>
											#end
										</select>
									</td>
								</tr>
								<tr height="40px">
									<td align="center" >文件描述</td>
									<td align="left" >
								<textarea style="font-family:'Microsoft YaHei'; font-size:14px; line-height:20px; height:140px; width:100%" name="fileDescribe" id="fileDescribe">$!{vo.fileDescribe}</textarea>
									</td>
								</tr>
		
	 						</table>
	  						<table class="sj_tl_3"  width="80%" border="0" cellspacing="0" cellpadding="0">
	 							<tr>
          						<th style="text-align:center; height:35px" colspan="2" >
            					<input style="height:30px; width:50px; " type="submit"  id="uploadPDF" name="uploadPDF"  value="保存"/>
		  						</th>
								</tr>
      						</table>
   					 	</div>
				 	</form>
				</div> <!-- /.portlet-content -->

		</div> <!-- /.portlet -->	
		
	</div> <!-- /.content-container-->
</div> <!-- #content -->
	

</body>
</html>